<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<f:metadata>
	<f:event type="preRenderView" listener="#{loginBean.preRenderView}" />
</f:metadata>

<f:view contentType="text/html">
	<h:head>
		<f:facet name="first">
			<meta content='text/html; charset=UTF-8' http-equiv="Content-Type" />
			<meta http-equiv="refresh" content="300; url=login.jsf" />
			<link href="resources/css/cssOverrides.css" rel="stylesheet"
				type="text/css" />
			<script src="resources/js/jquery.js" />
			<title>Login</title>
		</f:facet>
	</h:head>

	<h:body onload="loginDialog.show()">
		<p:growl id="growl" showDetail="true" sticky="false" />

		<table style="margin-left: auto; margin-right: auto;">
			<tr>
				<td><img src="resources/images/smta_logo.png" alt="SMTA REPORT"
					style="align: left" /></td>
			</tr>
			<tr>
				<td><img src="resources/images/irri_logo.png" alt="IRRI"
					style="align: left" /></td>
			</tr>
			<tr>
				<td><img src="resources/images/itpgrfa_logo.png" alt="ITPGRFA"
					style="align: left" /></td>
			</tr>
		</table>
		<p:dialog id="dialog" header="User Login" modal="false"
			closable="false" widgetVar="loginDialog">
			<h:form>
				<h:panelGrid columns="2" cellpadding="2">
					<h:outputLabel value="Username:" />
					<h:inputText value="#{loginBean.username}" label="Username"
						style="width: 200px" />
					<h:outputLabel value="Password:" />
					<h:inputSecret value="#{loginBean.password}" style="width: 200px" />
					<div align="center">
						<p:commandButton id="loginButton" value="Login" ajax="false"
							icon="ui-icon-home" action="#{loginBean.login}"
							oncomplete="loginDialog.hide()" />
					</div>
				</h:panelGrid>
			</h:form>
		</p:dialog>
	</h:body>
</f:view>

</html>
